<template>
    <div id="home">
      <view-box>
        <panel :list="dataList"></panel>

        <section class="SayHello">
          <ul>
            <li>{{$store.state.getCookie('code') == "0"?"杨紫":"邓嘉伦"}}：请求添加您为好友</li>
          </ul>
        </section>

        <router-link to="" class="SetUp">设置备注和标签</router-link>

        <section class="region">
          <div>地区 <span>九奚山</span></div>
          <section class="photo">
            个人相册 <ul v-if="starWoman">
            <li v-for="(items,index) in infoPhoto.YZ" :key="index">
              <img :src="items.img" alt="" />
            </li>
          </ul>

            <ul v-if="starMan">
              <li v-for="(items,index) in infoPhoto.DJL" :key="index">
                <img :src="items.img" alt="" />
              </li>
            </ul>
          </section>
          <div>来源 <span>对方通过搜索微信号添加</span></div>
        </section>

        <router-link to="/ChatRoom" class="agree">通过验证</router-link>
      </view-box>
    </div>
</template>

<script>
    import {ViewBox,Panel} from "vux";
    import sex_man from "@/common/images/sex-man.png"
    import sex_woman from "@/common/images/sex-woman.png"
    import YZ1 from "@/common/images/photo/YZ1.jpg";
    import YZ2 from "@/common/images/photo/YZ2.jpg";
    import YZ3 from "@/common/images/photo/YZ3.jpg";
    import YZ4 from "@/common/images/photo/YZ4.jpg";

    import DJL1 from "@/common/images/photo/DJL1.jpg";
    import DJL2 from "@/common/images/photo/DJL2.jpg";
    import DJL3 from "@/common/images/photo/DJL3.jpg";
    import DJL4 from "@/common/images/photo/DJL4.jpg";


    export default {
      components: {ViewBox,Panel},
      name: "home",
      data() {
        let name = '';
        let head_img = this.$store.state.getCookie('headImg');
        let code = this.$store.state.getCookie('code');
        let icon_sex_woman = sex_woman;
        // alert(name);

        code == "0"?name = "杨紫":name = "邓嘉伦";
        code == "0"?icon_sex_woman = sex_woman:icon_sex_woman = sex_man;

        return {
          starMan:false,
          starWoman:false,
          dataList:[{
            src:this.$store.state.getCookie('headImg'),
            title:name+"<i></i><img src="+ icon_sex_woman +" style='width:0.6045789rem;margin-top:0.2267rem; margin-right:0.9rem ;margin-left:0.617rem;'/>",
          }],
          infoPhoto:{
            YZ:[
              {img:YZ1},
              {img:YZ2},
              {img:YZ3},
              {img:YZ4}
              ],
            DJL:[
              {img:DJL1},
              {img:DJL2},
              {img:DJL3},
              {img:DJL4}
              ]
          }
        }
      },

      created() {
      },
      computed:{
        store() {
          return this.$store.state;
        }
      },
      mounted() {
        this.store.getCookie('code') == "0"?this.starWoman = true:this.starMan = true;
        console.log($(".weui-media-box__thumb").attr('src'))
      },
      methods:{

      },

    }
</script>

<style lang="less">

  @import '~vux/src/styles/reset.less';

</style>
